<template>
  <div>
    <navy>
      <div slot="main">
        <h1 id="h1">学习资料</h1>
        <a-list
          size="large"
          :pagination="true"
          :dataSource="dataSource"
        >
          <a-list-item slot="renderItem" slot-scope="item">
            <ul>
              <li>
                <router-link :to="{name:'view',query:{articleId:item.articleId}}" style="color:black;font-size:large;">
                  {{ item.articleTitle }} {{ item.createTime }}
                </router-link>
              </li>
            </ul>
          </a-list-item>
        </a-list>
      </div>
    </navy>
  </div>
</template>

<script>
import Navy from './nav'

export default {
  name: 'Study',
  components: {
    Navy
  },
  data () {
    return {
      dataSource: []
    }
  },
  created () {
    this.axios.get('/api/findAllArticle').then((res) => {
      if (res.status) {
        var datajob = JSON.parse(res.data)
        const arrjob = []
        for (let i = 0; i < datajob.length; i++) {
          if (datajob[i].articleTag === '学习资料' && datajob[i].imgUrl === undefined) {
            arrjob.push(datajob[i])
          }
        }
        this.dataSource = arrjob
      }
    })
  }
}
</script>

<style scoped>
@import "../style/style.css";
</style>
